package com.miao.UserClass;


import com.miao.entity.Fruit;
import org.springframework.beans.factory.FactoryBean;


/**
* Description: 水果工厂Bean
*/

public class FruitFactoryBean implements FactoryBean<Fruit> {

//返回一个 Fruit对象，会被添加到容器中
@Override
public Fruit getObject() throws Exception {
    return new Fruit("Apple", "green");
}


@Override
public Class<?> getObjectType() {
    return Fruit.class;
}

@Override
public boolean isSingleton() {
    return true;
}


@Override
public String toString() {
    return "FruitFactoryBean{}";
}
}
